<template>
    <div class="wrap">
        <div class="main" v-if="!is_error">
            Home {{meeting.name}} {{is_error}}
        </div>
        <Error v-if="is_error" msg="当前没有需要评审的场次"/>
    </div>
</template>
<script>
import { index, getConfig } from '@/api/index'
import { isEmptyObject } from '@/utils'
import { ElMessage } from 'element-plus'
import { useStore } from "vuex";
import { h, computed, onMounted, reactive, ref, toRefs } from "vue";
import Error from '@/components/Error'
import { useRouter } from 'vue-router';
export default {
    name: 'Home',
    components: {Error},
    setup() {
        let config = {
            is_error: ref(false)
        }
        const router = useRouter()
        const store = useStore()
        let meeting = reactive({})

        function init() {
            index().then(response => {
                // // return () => h('div',null, [h(Error, {msg:'当前没有需要评审的场次'})])
                if (response.code == 200) {
                    router.push('/review_time/' + response.data.meeting_time.id)
                }
            }, error => {
                ElMessage.error('请求异常')
            })
        }
        init()

        return {
            meeting,
            ...config
        }
        // return () => h('div',null, [h(Error, {msg:'当前没有需要评审的场次'})])
    }
}
</script>